#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int sep(double x, int* intptr)
{
    *intptr = (int)x;
    int n = 0;
    x = x - *intptr;
    double m = x;
    while (x> 1e-6)
    {
        x = x * 10;
        m *= 10;;
        n = (int)x;
        x = x - n;
    }
    return m;
}

int main() {

    double x = 12.3457;

    int i = 0;  

    int f = sep(x, &i); 

    printf("intpart: %d\nfractpart: %d\n", i, f);

    return 0;

}